﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq;
using System.Configuration;
using SmartCollector.Domain;
using SmartCollector.Domain.Entity;
namespace SmartCollector.Domain.Repository
{
    public class SiteRepository
    {
        private Table<tbl_ReferenceSite> m_sites;
        public IQueryable<tbl_ReferenceSite> Sites
        {
            get
            {
                return m_sites.AsQueryable();
            }
        }

        public SiteRepository()
        {
            m_sites = (new EntityDomainDataContext()).GetTable<tbl_ReferenceSite>();
        }

        public void AddNewSites(tbl_ReferenceSite site)
        {
            m_sites.InsertOnSubmit(site);
        }

        public void SubmitChanges()
        {
            m_sites.Context.SubmitChanges();
        }

    }
}
